from rest_framework.filters import BaseFilterBackend
from django_filters import rest_framework as filters
from .models import City,CityData,CityReview


class CityFilter(filters.FilterSet):
	name = filters.CharFilter(lookup_expr='icontains')

	class Meta:
		model = City
		fields = ['name','year']


class CityDataFilter(filters.FilterSet):
	publish_time = filters.CharFilter(lookup_expr='icontains')
	weather = filters.CharFilter(lookup_expr='icontains')

	class Meta:
		model = CityData
		fields = ['publish_time','week','weather','city__name']